import { request } from '@/utils/request'

// 登录接口
export const login = (data) => request.post('/api/auth/login', data)

// 注册接口
export const register = (data) => request.post('/api/auth/register', data)

// 查询所有老师
export const getAllTeacher = () => request.get('/api/teachers')

// 查询单个老师
export const getTeacherById = (id) => request.get(`/api/teachers/${id}`)

// 新增老师
export const addTeacher = (data) => request.post('/api/teachers', data)

// 修改老师
export const updateTeacher = (id, data) => request.put(`/api/teachers/${id}`, data)

// 删除老师
export const deleteTeacher = (id) => request.delete(`/api/teachers/${id}`)


// 查询所有班级
export const getAllClass = () => request.get('/api/classes')

// 新增班级
export const addClass = (data) => request.post('/api/classes', data)

// 修改班级
export const updateClass = (id, data) => request.put(`/api/classes/${id}`, data)

// 删除班级
export const deleteClass = (id) => request.delete(`/api/classes/${id}`)


// 查询所有学生
export const getAllStudents = () => request.get('/api/students')

// 查询单个学生
export const getStudentsById = (id) => request.get(`/api/students/${id}`)

// 新增学生
export const addStudents = (data) => request.post('/api/students', data)

// 修改学生
export const updateStudents = (id, data) => request.put(`/api/students/${id}`, data)

// 删除学生
export const deleteStudents = (id) => request.delete(`/api/students/${id}`)


// 查询班级概况信息
export const getClassInfo = () => request.get('/api/classes/current-info')

// 性别统计
export const getGenderInfo = () => request.get('/api/stats/gender-distribution')

// 身高统计
export const getHeightInfo = () => request.get('/api/stats/height')

// 体重统计
export const getWeightInfo = () => request.get('/api/stats/weight')